<template>
    <el-select v-model="val" filterable :placeholder="'请选择'+select.name" @change="change">
        <el-option
                v-for="item in select.data"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</template>

<script setup>
import { computed } from 'vue'
defineProps({
  select: Object,
  value: String
})
let emit = defineEmits(["input","callback"])
const change=(val) => {
  emit('input', val)
  emit('callback', val)
}
const val = computed({
  get () {
    return value
  },
  set (newValue) {
    // 如果需要设置值，可以在这里处理
    value.value = newValue;
  }
});
// const buildChild = (val) => {
//   let select_item = this.select.data.find(item => {
//     return item.value == val
//   })
//   return select_item && select_item.children
// }
</script>

<style scoped>

</style>